package org.jiajie.designpatterndemo.interpreter.runoob;

/**
 * 实现Expression接口的实体类
 * @author jie
 * @date 2021/10/13 10:06 PM
 */
public class TerminalExpression implements Expression{
    private String data;

    public TerminalExpression(String data) {
        this.data = data;
    }

    @Override
    public boolean interpret(String context) {
        if (context.contains(data)){
            return true;
        }
        return false;
    }
}
